<!DOCTYPE html>
<html>
<head>
	<title>onlineApply.html</title>

	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="this is my page">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="../../../plugins/bootstrap/css/bootstrap.min.css"
		type="text/css"></link>
	<!-- <link rel="stylesheet" href="../../../plugins/FlatUI/dist/css/flat-ui.css"
		type="text/css"></link> -->
	<link rel="shortcut icon" href="../../../plugins/FlatUI/dist/img/favicon.ico">
	<link rel="stylesheet" href="../../../css/style.css">
	<script type="text/javascript" src="../../../js/jquery.js"></script>
	<script type="text/javascript" src="../../../plugins/FlatUI/dist/js/flat-ui.js"></script>
	<script type="text/javascript" src="../../../js/base.js"></script>
	 <script src="../../../js/template.js"></script>
	<script src="../../../js/bootstrap-paginator.js"></script>
	<script src="../../../js/bootstrap-mypaginator.js"></script>
<script type="text/javascript">
//分页查询
function ajaxLoadData(data){
	$.ajax({
		url:commonurl+"/selectAll.product",
		type:"POST",
		data:data,
		dataType:"json",
		success:function(data){
			if(data.success){
			obj=data.obj;		
		/* 	obj.list.forEach(function(value,index){
					value.houseType=value.houseType.split(",");
					value.createTime=new Date(value.createTime) ;
					value.createTime=value.createTime.getFullYear() + "年" + (value.createTime.getMonth() + 1) + "月" + value.createTime.getDate() + "日 " + value.createTime.getHours() + "点" + value.createTime.getMinutes() + "分" + value.createTime.getSeconds() + "秒";
			}) */
			var datas={
                	sources:obj.list,
                	commonurlimg:commonurlimg
            	};
			$("#productContent").html(template("productTemplate",datas));
		/* 	obj.list.forEach(function(value,index){
				if(value.status==-1){
			 		$("."+value.id).html("已删除");
			 		$("#"+value.id).html("");
				}
			}) */
			myPaginatorFun("myPages", obj.pageNo, obj.pages);
		}else{
			alert(data.msg);
		}
		}

	})
}



$(function(){
	//刚进页面加载数据
 	ajaxLoadData({
		
		pageNo:1
	}); 
	myoptions.onPageClicked = function(event, originalEvent, type, page) {
		ajaxLoadData({
			pageNo:page
		});
	};
})
function findApply(id,name) {
	
		sessionStorage.setItem('productId',id);
		sessionStorage.setItem('productName',name);
 		 location.href="onlineApplyDetail.html";
}



</script>


</head>

<body style="padding: 5px 10px">

	<div class="panel panel-primary">
	  <div class="panel-heading">
	    <h3 class="panel-title">在线申请管理</h3>
	  </div>
	  <div class="panel-body">
	  		<table class="table table-hover">
	  			<thead>
	  				<tr>
	  					<th>产品名称</th>
	  					<th>发行单位</th>
	  					<th>产品类型</th>
	  					<th>贷款周期</th>
	  					<th>贷款利率</th>
	  					<th>贷款规模</th>
	  					<th>状态</th>
	  					<th>操作</th>
	  				</tr>
	  			</thead>
	  			<tbody id="productContent">
	  			
	  			<script id="productTemplate" type="text/html">
	  			{{each sources as i}}
		  			<tr> 	 	 	 	 	 
		  				<td>{{i.proName}}</td>
		  				<td>{{i.company.companyName}}</td>
		  				<td>{{i.productType.productTypeName}}</td>
		  				<td>{{i.period.periodName}}</td>
		  				<td>{{i.rateFrom}}%-{{i.rateTo}}%</td>
		  				<td>{{i.amountFrom}}-{{i.amountTo}}万</td>
		  				<td>有效产品</td>
		  				<td>
		  					<a class="btn btn-primary  btn-xs btn-success"  onclick="findApply('{{i.id}}','{{i.proName}}')"  >
		  						在线申请详情
		  						<span class="glyphicon glyphicon-arrow-right"></span>
		  					</a>
		  				</td>
		  			</tr>
               {{/each}}
</script>
		  		<!-- 	<tr> 	 	 	 	 	 
		  				<td>助保贷</td>
		  				<td>兴业银行南京分行</td>
		  				<td>其他</td>
		  				<td>12个月</td>
		  				<td>%</td>
		  				<td>500万</td>
		  				<td>有效产品</td>
		  				<td>
		  					<a class="btn btn-primary  btn-xs btn-success">
		  						在线申请详情
		  						<span class="glyphicon glyphicon-arrow-right"></span>
		  					</a>
		  				</td>
		  			</tr>
		  			<tr> 	 	 	 	 	 
		  				<td>助保贷</td>
		  				<td>兴业银行南京分行</td>
		  				<td>其他</td>
		  				<td>12个月</td>
		  				<td>%</td>
		  				<td>500万</td>
		  				<td>有效产品</td>
		  				<td>
		  					<a class="btn btn-primary  btn-xs btn-success">
		  						在线申请详情
		  						<span class="glyphicon glyphicon-arrow-right"></span>
		  					</a>
		  				</td>
		  			</tr> -->
	  			</tbody>
	  		</table>
	  </div>
	</div>
	<div style="text-align: center;">
						<ul id="myPages" ></ul>
					</div>
	
</body>
</html>
